<!DOCTYPE html>
<html>
<head>
    <title>订单详情</title>
    <#include "../common.ftl">
</head>
<body class="childrenBody">
发货列表
<table class="layui-table" style="text-align: center">
    <thead>
    <tr>
        <th style="text-align: center">订单编号</th>
        <th style="text-align: center">收货人</th>
        <th style="text-align: center">电话号码</th>
        <th style="text-align: center">邮政编码</th>
        <th style="text-align: center">收货地址</th>
        <th style="text-align: center">配送方式</th>
        <th style="text-align: center">物流单号</th>
    </tr>
    </thead>
    <tbody>
    <tr style="width: 100px">
        <td id="odId">${(model.odId)!}</td>
        <td id="userName">${(model.userName)!}</td>
        <td id="userPhone">${(model.userPhone)!}</td>
        <td id="postCode">${(model.postCode)!}</td>
        <td id="userAddress">${(model.userAddress)!}</td>
        <td>
            <select id="companyName">
                <option>顺丰快递</option>
                <option>圆通快递</option>
                <option>中通快递</option>
                <option>京东快递</option>
                <option>其他快递</option>
            </select>
        </td>
        <td>
            <input type="text" id="postid"  />
        </td>
    </tr>
    </tbody>
</table>
<br><br><br><br>
<div class="layui-btn-container">
    <a class="layui-btn layui-btn-normal addNews_btn" lay-event="" id="closeBtn">
        <i class="layui-icon">&#xe608;</i>
        取消
    </a>
    <a class="layui-btn layui-btn-normal delNews_btn" lay-event="" id="send">
        <i class="layui-icon">&#xe640;</i>
        确认发货
    </a>
</div>
</body>
<script>
    layui.use(['form', 'jquery', 'jquery_cookie'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery
        var odId = $("#odId").text();
        var userName = $("#userName").text();
        var userPhone = $("#userPhone").text();
        var postCode = $("#postCode").text();
        var userAddress = $("#userAddress").text();
        $("#send").click(function () {
            var companyName = $("#companyName").val();
            var postId = $("#postid").val();
            $.ajax({
                type: "post",
                url: "send",
                data: {
                    odId: odId,
                    companyName: companyName,
                    userName: userName,
                    userPhone: userPhone,
                    postCode: postCode,
                    address: userAddress,
                    postId: postId
                },
                success: function (result) {
                    if (result.code == 200) {
                        var index = parent.layer.getFrameIndex(window.name);
                        // 再执⾏关闭
                        parent.layer.close(index);
                        layui.layer.msg(result.msg)
                        parent.location.reload();
                    } else {
                        layui.layer.msg(result.msg)
                    }
                }
            })
        })

        $("#closeBtn").click(function () {
            // 先得到当前iframe层的索引
            var index = parent.layer.getFrameIndex(window.name);
            // 再执⾏关闭
            parent.layer.close(index);
        });

    });
</script>
</html>